﻿using com.foxmail.wyyuan1991.Assignment.Host;
using com.foxmail.wyyuan1991.Assignment.Solver;
using System;

namespace com.foxmail.wyyuan1991.Assignment.CmdShell
{
    class Program
    {
        static void Main(string[] args)
        {
            //生成一个网络
            INetwork net = DataGenerator.GenTestNetwork3();
            Reporter.ReportNetwork(net);
            //生成客运需求
            IDemand f = DataGenerator.GenTestFlow(net);
            Reporter.ReportDemand(net, f);

            Console.WriteLine("F-W算法求解Backmann模型");
            //初始化F-W求解器
            FWSolver s = new FWSolver()
            {
                kesi = 0.001d,//设置收敛阈值
                SA = new DijstraRouteSearcher(),
                AS = new AoNSolver() { SA = new DijstraRouteSearcher() },
                LS = new DichotomyLineSearcher() { Kesi = 0.0001d }
            };
            IFlowPattern ifd = s.Solve(net, f);
            Console.WriteLine("结果为：");
            Reporter.ReportFlowPattern(net, ifd);

            Console.ReadLine();
        }
    }
}
